<script src="<?echo base_url()?>assets/melamud/js/address.js"></script>
<script src="https://maps.google.com/maps/api/js?sensor=false&libraries=places"></script>

<script language="javascript">
	$(document).ready(function() {
	
		/*********************************************************/
		allFields = $( [] ).add($('#txtNombre'))
							.add($('#txtTelefono'))
							.add($('#txtEmail'))
							.add($('#txtComentario'))
							.add($('#txtTuNombre'))
							.add($('#txtTuMail'))
							.add($('#txtSuNombre'))
							.add($('#txtSuMail')),
		tips = $( ".validateTips" );
	  
  
		function updateTips( t ) {
		  tips
			.text( t )
			.addClass( "ui-state-highlight" );
		  setTimeout(function() {
			tips.removeClass( "ui-state-highlight", 1500 );
		  }, 500 );
		}

		function checkLength( o, n ) {
		  if ( o.val() == "" ) {
			o.addClass( "ui-state-error" );
			updateTips( "El campo " + n + " no puede ser vacio ");
			return false;
		  } else {
			return true;
		  }
		}
		
		function checkRegexp( o, regexp, n ) {
		  if ( !( regexp.test( o.val() ) ) ) {
			o.addClass( "ui-state-error" );
			updateTips( 'El formato de email no es correcto:' + n );
			return false;
		  } else {
			return true;
		  }
		}
		/*********************************************************/
	
		$( "#imgUbicacion" )
		  .click(function() {
			$("#divGaleria").hide();
			$("#divUbicacion").show();
		  });
		$("#imgUbicacion").css('cursor', 'pointer');

		$("#imgFicha")
		  .click(function() {
			$("#divGaleria").show();
			$("#divPlano").hide();
		  });
		$("#imgFicha").css('cursor', 'pointer');

		$("#imgPlano")
		  .click(function() {
			$("#divGaleria").hide();
			$("#divPlano").show();
		  });
		$("#imgPlano").css('cursor', 'pointer');
		
		$( "#contact-form" ).dialog({
			  position:{ my: "top", at: "top", of: window },
			  autoOpen: false,
			  height: 360,
			  width: 700,
			  modal: true,
			  open: function( event, ui ) {
				$("#imgContactoForm").attr("src",strImgSeleccionada);
			  },
			  buttons: {
				"Aceptar": function() {
					var bValid = true;
					$('#nombre').val($('#txtNombre').val());
					$('#telefono').val($('#txtTelefono').val());
					$('#email').val($('#txtEmail').val());
					$('#comentario').val($('#txtComentario').val());
					
					/**************************************************************/
					allFields.removeClass( "ui-state-error" );
					bValid = bValid && checkLength( $('#txtNombre'), "Nombre");					
					bValid = bValid && checkLength( $('#txtTelefono'), "Telefono");					
					bValid = bValid && checkLength( $('#txtEmail'), "Email");					
					bValid = bValid && checkLength( $('#txtComentario'), "Comentario");
					
					bValid = bValid && checkRegexp( $('#txtEmail'), /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i, "Ej. info@melamudpropiedades.com" );
					
					/**************************************************************/
					if ( bValid ) {
						guardarAjax("<?echo base_url()?>index.php/principal/addContacto/6");
						//$('#formHead').attr('action','<?echo base_url()?>index.php/principal/addContacto');
						//$('#formHead').submit();
						$( this ).dialog( "close" );
					}
				},
				Cancel: function() {
				  $( this ).dialog( "close" );
				}
			  },
			  close: function() {
			}
		});	
		
		$( "#enviar-form" ).dialog({
			  position:{ my: "top", at: "top", of: window },
			  autoOpen: false,
			  height: 340,
			  width: 700,
			  modal: true,
			  open: function( event, ui ) {
				$("#imgContactoForm").attr("src",strImgSeleccionada);
			  },
			  buttons: {
				"Aceptar": function() {
					var bValid = true;
					$('#tuNombre').val($('#txtTuNombre').val());
					$('#tuMail').val($('#txtTuMail').val());
					$('#suNombre').val($('#txtSuNombre').val());
					$('#suMail').val($('#txtSuMail').val());
					
					/**************************************************************/
					allFields.removeClass( "ui-state-error" );
					bValid = bValid && checkLength( $('#txtTuNombre'), "Tu nombre");					
					bValid = bValid && checkLength( $('#txtTuMail'), "Tu email");					
					bValid = bValid && checkLength( $('#txtSuNombre'), "Su nombre");					
					bValid = bValid && checkLength( $('#txtSuMail'), "Su mail");
					
					bValid = bValid && checkRegexp( $('#txtTuMail'), /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i, "Ej. info@melamudpropiedades.com" );
					bValid = bValid && checkRegexp( $('#txtSuMail'), /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i, "Ej. info@melamudpropiedades.com" );
					
					/**************************************************************/
					if ( bValid ) {
						guardarAjax("<?echo base_url()?>index.php/propiedades/enviarPropiedad/<?echo $propiedad[0]->idPropiedad?>");
						//$('#formHead').attr('action','<?echo base_url()?>index.php/principal/enviarPropiedad/<?echo $propiedad[0]->idPropiedad?>');
						//$('#formHead').submit();
						$( this ).dialog( "close" );
					}
				},
				Cancel: function() {
				  $( this ).dialog( "close" );
				}
			  },
			  close: function() {
			}
		});
		var options; 
		initialize_chico();
		<? if ($propiedad[0]->mapa_lat != ''){ ?>
			
			map.setCenter(new google.maps.LatLng(<?=$propiedad[0]->mapa_lat?>,<?=$propiedad[0]->mapa_lng?>)); 
			map.setZoom(13); 
			var marker = new google.maps.Marker({ 
				map: map, 
				position: new google.maps.LatLng(<?=$propiedad[0]->mapa_lat?>,<?=$propiedad[0]->mapa_lng?>) 
			});
			var contentString = '<div id="iwContent"><?echo ($propiedad[0]->titulo);?></div>';
				
			var myOptions = {
				content: contentString
			};
			
			var infowindow = new google.maps.InfoWindow(myOptions);
			google.maps.event.addListener(marker, 'click', function() {
				infowindow.open(map,marker);
			});
			<? 	$count = 0; 
				foreach ($propiedadesCercanas as $val) { 
					$count +=1; ?>
					var html = "<b>" + "<?=$val->address?>" + "</b> <br/>";
					var markerNear<?echo $count;?>  = new google.maps.Marker({ 
						map: map, 
						position: new google.maps.LatLng(<?=$val->mapa_lat?>,<?=$val->mapa_lng?>) 
					});
					
					var contentStringNear<?echo $count;?> = '<div id="iwContent"><a class="linknegro" href="<?= base_url() ?>index.php/propiedades/ficha/<?= $val->idPropiedad ?>"><?echo ($val->titulo);?></a></div>';
					var myOptionsNear<?echo $count;?> = {
						content: contentStringNear<?echo $count;?>
					};
				
					var infowindowNear<?echo $count;?> = new google.maps.InfoWindow(myOptionsNear<?echo $count;?>);
					google.maps.event.addListener(markerNear<?echo $count;?>, 'click', function() {
						infowindowNear<?echo $count;?>.open(map,markerNear<?echo $count;?>);
					});
					iconFile = 'http://maps.google.com/mapfiles/ms/icons/yellow-dot.png'; 
					markerNear<?echo $count;?>.setIcon(iconFile);
			<? } ?>
		<? } ?>
		
		$("#divPlano").hide();

		$( "#imgFicha" ).click(function() {
			$( "#imgFicha" ).attr("src","<?= base_url() ?>assets/melamud/img/ficha-verde.png");
			$( "#imgPlano" ).attr("src","<?= base_url() ?>assets/melamud/img/plano.png");
		});
		
		$( "#imgPlano" ).click(function() {
			$( "#imgPlano" ).attr("src","<?= base_url() ?>assets/melamud/img/plano-verde.png");
			$( "#imgFicha" ).attr("src","<?= base_url() ?>assets/melamud/img/ficha.png");
		});
		
	});
	$(function(){
		$('#myGallery').galleryView({
			 panel_width: 740,
			 panel_height: 430,
			 show_filmstrip_nav: false,
		});
	});
	function goBack()
	{
		$('#formHead').attr('action','<?= $linkAnterior ?>');
		$('#formHead').submit();
	}
	
	function guardarAjax(url,dataString)
	{
		$.ajax({  
		  type: "POST",  
		  url: url,
		  dataType: 'text',  
		  data: $("#formHead").serialize(),  
		  success: function(dataOk) {  
			alert(dataOk);
		  }  
		});  
	}

</script>
<div id="fb-root"></div>
<script>
	window.fbAsyncInit = function() {
		FB.init({appId: '555370011175853', status: true, cookie: true,
		xfbml: true});
	};
	(function() {
	var e = document.createElement('script'); e.async = true;
	e.src = document.location.protocol +
	'//connect.facebook.net/en_US/all.js';
	document.getElementById('fb-root').appendChild(e);
	}());
</script>
<script>
	FB.init({appId: "234092069940761", status: true, cookie: true});
	function share_me(url,titulo) {
		FB.ui({
			method: 'feed',
			app_id: '555370011175853',
			link: url,
			picture: '<?= base_url() ?>assets/melamud/img/logocabezal.png',
			name: 'Melamud Propiedades',
			caption: titulo,
			description: '',
			display: 'popup'
		},
		function(response){
			if(response && response.post_id) {
				self.location.href = '#'
			}
			else {
			}
		});
	return false;
	} 
	
</script>
<div id="contact-form" style="display:none" title="Contacto">
	<input type="hidden" id="linkAnterior" value="<? echo $linkAnterior ?>" name="linkAnterior" />
	<p class="validateTips">Gracias por consultarnos, d&eacutejenos su inquietud y le contestaremos a la brevedad</p>
	<fieldset>
		<div style="float:left">
			<table width="370" border="0">
				<tr>
					<td width="59" align="right" valign="middle">
						<table width="20" border="0">
							<tr>
								<td width="10"><img src="<?= base_url() ?>assets/melamud/img/paramasinfo.png" alt="" width="28" height="133" /></td>
							</tr>
						</table>
					</td>
					<td width="362" align="center" valign="middle">
						<div id="divContactoNombre"><input name="txtNombre" type="text" class="" placeholder="Nombre" id="txtNombre" size="40" /></div>
						<div id="divContactoTelefono"><input name="txtTelefono" type="text" placeholder="Telefono" class="textobase" id="txtTelefono" size="40" /></div>
						<div id="divContactoEmail"><input name="txtEmail" type="text" placeholder="Email" class="textobase" id="txtEmail" size="40" /></div>
						<div id="divContactoComentario"><textarea name="txtComentario" placeholder="Comentario" cols="35" rows="3" class="textobase" id="txtComentario"></textarea></div>
					</td>
				</tr>
			</table>
		</div>
		<div class="elementoFormContacto">
			<img id="imgContactoForm" width="265px" height="167px" src="<?= base_url() ?>assets/melamud/img/logomelamud-form.png">
		</div>
	</fieldset>
</div>
<div id="enviar-form" style="display:none" title="Contacto">
	<p class="validateTips">Enviar por mail</p>
	<fieldset>
		<div style="float:left">
			<table width="370" border="0">
				<tr>
					<td width="59" align="right" valign="middle">
						<table width="20" border="0">
							<tr>
								<td width="10"><img src="<?= base_url() ?>assets/melamud/img/paramasinfo.png" alt="" width="28" height="133" /></td>
							</tr>
						</table>
					</td>
					<td width="362" align="center" valign="middle">
						<div id="divContactoNombre"><input name="txtTuNombre" type="text" class="textobase" placeholder="Tu nombre" id="txtTuNombre" size="40" /></div>
						<div id="divContactoTelefono"><input name="txtTuMail" type="text" placeholder="Tu Email" class="textobase" id="txtTuMail" size="40" /></div>
						<div id="divContactoEmail"><input name="txtSuNombre" type="text" placeholder="Su Nombre" class="textobase" id="txtSuNombre" size="40" /></div>
						<div id="divContactoComentario"><input name="txtSuMail" type="text" placeholder="Su Email" class="textobase" id="txtSuMail" size="40"></input></div>
					</td>
				</tr>
			</table>
		</div>
		<div class="elementoFormContacto">
			<img id="imgContactoForm" width="265px" height="167px" src="<?= base_url() ?>assets/melamud/img/logomelamud-form.png">
		</div>
	</fieldset>
</div>

<input id='tuNombre' name='tuNombre' type='hidden' value='' />
<input id='suNombre' name='suNombre' type='hidden' value='' />
<input id='tuMail' name='tuMail' type='hidden' value='' />
<input id='suMail' name='suMail' type='hidden' value='' />
<input id='linkPropiedad' name='linkPropiedad' type='hidden' value='<?= base_url() ?>index.php/propiedades/ficha/<?= $propiedad[0]->idPropiedad ?>'/>

<input id='nombre' name='nombre' type='hidden' value='' />
<input id='telefono' name='telefono' type='hidden' value='' />
<input id='email' name='email' type='hidden' value='' />
<input id='comentario' name='comentario' type='hidden' value='' />
<input name="propiedadConsultada" id="propiedadConsultada" type="hidden" value="<?= current_url() ?>"></input>

<div id="principal4">
  <table width="1024" height="1224" border="0">
    <tr>
      <td width="243" height="1165" valign="top">
		<?php echo $barraFiltros; ?>
      </td>
      <td width="750" align="center" valign="top">
	  <table width="749" height="1012" border="0" cellpadding="0" cellspacing="0">
        <tr>
			<td class="barraFicha">
				<div class="divBarraFicha">
					<a href="#" onclick='javascript:goBack();'><div id="divBotonVolver"></div></a>
					<a href="#" onclick='javascript:$( "#enviar-form" ).dialog( "open" );'><div id="divBotonEnviar"></div></a>
					<a href="#" onclick="javascript:return share_me('<?= base_url() ?>index.php/propiedades/ficha/<?= $propiedad[0]->idPropiedad ?>','<?= $propiedad[0]->titulo ?>')" target="_blank"><div id="divBotonCompartir"></div></a>
					<a target="_blank" href="<?= base_url() ?>index.php/propiedades/imprimir/<? echo $propiedad[0]->idPropiedad ?>"><div id="divBotonImprimir"></div></a>
					<a href="#" onclick='javascript:$( "#contact-form" ).dialog( "open" );'><div id="divBotonConsultas"></div></a>
				</div>
			</td>
		</tr>
		<tr>
          <td width="749" height="30" class="textomenu3">&nbsp;&nbsp;&nbsp;
			<div class="tituloFichaIzq">
				<?=($propiedad[0]->titulo)?>
			</div>
			<div class="tituloFichaDer">
				
			</div>
			<span class="divEtiquetaFicha precio-grande">
				<? if ($propiedad[0]->idTipoOperacion == 1) {?>
					<div class="textoprecio" id="precio">$ <?= number_format($propiedad[0]->precioPeso, 0, ',','.')?></div>
				<? } else if ($propiedad[0]->idTipoOperacion == 2) {?>
					<div class="textoprecio" id="precio"><? if($propiedad[0]->precioDolar > 0) { ?>u$s <?=  number_format($propiedad[0]->precioDolar, 0, ',','.') ?> <? } else { ?>$ <?= number_format($propiedad[0]->precioPeso, 0, ',','.')?> <? } ?></div>
				<? } ?>
			</span>
		  </td>
        </tr>
        <? if ($fotos[0] != NULL) { ?>
		<tr>
		
          <td height="434" align="center">
          <div id="menuimagen"> 
			  <? if ($fotos[0] != NULL) { ?>
				<div id="ficha"> <img id="imgFicha" src="<?= base_url() ?>assets/melamud/img/ficha-verde.png" /></div>
			  <? } ?>
			  <!--<div id="ubicacion"><img id="imgUbicacion" src="<?= base_url() ?>assets/melamud/img/ubicacion.png" /></div>-->
			  <? if ($propiedad[0]->fotoPlano != null) { ?><div id="plano"> <img id="imgPlano" src="<?= base_url() ?>assets/melamud/img/plano.png" /></div><? } ?>
			  <div id="imprimir"> <a target="_blank" href="<?= base_url() ?>index.php/propiedades/imprimir/<? echo $propiedad[0]->idPropiedad ?>"><img src="<?= base_url() ?>assets/melamud/img/imprimir.png" /></a> </div>
			  
          </div>
		  <? if ($fotos[0] != NULL) { ?>
			 <div id="divGaleria" >
				<ul id="myGallery">
					<? foreach ($fotos as $val) { ?>
						<? if ($val["name"] != $propiedad[0]->fotoPlano) {?>
							<li><img src="<?=$val["path"]?>"/>
						<? } ?>
					<? } ?>
				</ul>
			 </div>
		 <div id="divPlano" >
			<img height="475" width="740" src="<?= base_url() ?>assets/melamud/uploads/<?= $propiedad[0]->idPropiedad ?>/<?=$propiedad[0]->fotoPlano?>"/>
         </div>
          </td>
		  <? } ?>
        </tr>
		<? } else {?>
			<tr height="10"></tr>
		 <? } ?>
        <tr>
          <td height="20">
			<table width="750" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td height="30" colspan="8" class="textomenu4">&nbsp;&nbsp;CARACTERISTICAS DEL DEPARTAMENTO</td>
              </tr>
				<?
					$count = 3;
					$countColor = 1;

					foreach ($datosFicha as $key => $dato) {
						echo "<tr>";
						if ($countColor % 2){
							echo "<td height='32' class='textomenu2'>&nbsp;&nbsp;" . strtoupper(($dato["desc"])) . ":</td>";
							echo "<td align='left' class='textomenu2a'>". $dato["valor"] ."</td>";
						}else{
							echo "<td height='32' class='textomenu4'>&nbsp;&nbsp;" . strtoupper(($dato["desc"])) . ":</td>";
							echo "<td align='left' class='textomenu4a'>". $dato["valor"] ."</td>";
						}
						echo "</tr>";
						$countColor += 1;
					}

/*					
					foreach ($datosFicha as $key => $dato) {
						if (($count % 3) == 0){
							echo "<tr>";
						}
						if ($countColor % 2){
							echo "<td height='32' class='textomenu2'>&nbsp;&nbsp;" . strtoupper($dato["desc"]) . ":</td>";
							echo "<td align='right' class='textomenu2a'>". $dato["valor"] ."</td>";
						}else{
							echo "<td height='32' class='textomenu4'>&nbsp;&nbsp;" . strtoupper($dato["desc"]) . ":</td>";
							echo "<td align='right' class='textomenu4a'>". $dato["valor"] ."</td>";
						}
						echo "<td> </td>";
						if ((($count + 1) % 3) == 0){
							echo "</tr>";
							$countColor += 1;
						}
						$count += 1;
					}
*/
					/*
					while (($count % 3) != 0){
						if ($countColor % 2){
							echo "<td height='32' class='textomenu2'></td>";
							echo "<td align='right' class='textomenu2a'></td>";
						}else{
							echo "<td height='32' class='textomenu4'></td>";
							echo "<td align='right' class='textomenu4a'></td>";
						}
						echo "<td> </td>";
						$count += 1;
					}
					
					if (($count % 3) == 0){
						echo "</tr>";
						$countColor += 1;
					}
					*/
				?>
		
          </table></td>
        </tr>
		<tr height="10"><td></td></tr>
        <? 
		if (count($propAdicionales) > 0) {
		?>
			<tr>
			  <td height="30" valign="middle" class="textomenu4">&nbsp;&nbsp;AMENITIES</td>
			</tr>
			<tr>
			  <td height="29" class="textomenu5">
				<?
					foreach ($propAdicionales as $val){
				?>	
					<?=strtoupper($val->descripcion)?> - 
				<?
				}
				?>
			  
			  </td>
			</tr>
		<? } ?>
        <tr>
          <td align="left" style="vertical-align:top; padding-top: 10px;"><table width="750" border="0">
            <tr>
              <td width="369" height="29" class="textomenu4">&nbsp;&nbsp;DESCRIPCION</td>
              <td width="10" rowspan="2">&nbsp;</td>
              <td width="372" valign="middle" class="textomenu4">&nbsp;&nbsp;UBICACION </td>
            </tr>
            <tr>
              <td height="220" class="textomenu5">
				<?=($propiedad[0]->descripcion)?>
			  </td>
              <td valign="top" class="textomenu5">
				<div id='map_canvas_chico' style='height:210px;width:373px;top:5px'></div>
				
			  </td>
            </tr>
            </table></td>
        </tr>
		<tr height="10"><td></td></tr>
        <? 
		if (($propiedad[0]->requisitos != "" && $propiedad[0]->requisitos != null)) {
		?>
			<tr>
			  <td height="30" valign="middle" class="textomenu4">&nbsp;&nbsp;<? if ($propiedad[0]->idTipoOperacion == 1) { ?> REQUISITOS <? } else { ?> NOTAS <? } ?></td>
			</tr>
			<tr>
			  <td height="29" class="textomenu5">
				<?
					echo $propiedad[0]->requisitos
				?>
			  
			  </td>
			</tr>
		<? } ?>
        </table></td>
    </tr>
    <tr>
      <td height="21" valign="top">&nbsp;</td>
      <td align="center" valign="top">&nbsp;</td>
    </tr>
  </table>
</div>
